*******************************************************************************************************************************
*******************************************************************************************************************************
* Documentation for Reproduction of
* Van Boven 2006 TESS Survey Experiment
* TESS Race Discrimination Meta-Analysis
* Stata version 15
* Data available here: http://www.tessexperiments.org/data/vanboven467.html
*******************************************************************************************************************************
*******************************************************************************************************************************

* use "tess65_vanboven_final_data_CLIENT.dta", clear
set more off

*******************************************************************************************************************************
*** Racial groups
*******************************************************************************************************************************

tab ppethm
tab ppethm, nol
gen whiteR = ppethm
recode whiteR (2/5=0)
tab ppethm whiteR

gen blackR = ppethm
recode blackR (1 3/5=0) (2=1)
tab ppethm blackR

gen hispnR = ppethm
recode hispnR (1/3 5=0) (4=1)
tab ppethm hispnR

*******************************************************************************************************************************
*** Treatments
*******************************************************************************************************************************

tab emotion
tab picture
gen angry = emotion
recode angry (2=0)
tab emotion angry
gen blackT = picture
recode blackT (2=0)
tab picture blackT

*******************************************************************************************************************************
*** Outcome variables
*******************************************************************************************************************************

tab1 q5 q6 q7 q8 q9 q10 q11 q12
recode q5 q6 q7 q8 q9 q10 q11 q12 (-1=.)
tab1 q5 q6 q7 q8 q9 q10 q11 q12

gen noway2leave = 0-q10
gen isNOTlooting = q11
gen shouldNOTBprosecuted = q12
egen noway2leave_std = std(noway2leave)
egen isNOTlooting_std = std(isNOTlooting)
egen shouldNOTBprosecuted_std = std(shouldNOTBprosecuted)

alpha noway2leave_std isNOTlooting_std shouldNOTBprosecuted_std, item
alpha noway2leave_std isNOTlooting_std shouldNOTBprosecuted_std, item std min(2) gen(ALPHA)

sum ALPHA if whiteR==1
di r(sd)
gen ov_white_std = ALPHA/r(sd) if whiteR==1

sum ALPHA if blackR==1
di r(sd)
gen ov_black_std = ALPHA/r(sd) if blackR==1

sum ALPHA if hispnR==1
di r(sd)
gen ov_hispn_std = ALPHA/r(sd) if hispnR==1

*******************************************************************************************************************************
*** Racial manipulation check
*******************************************************************************************************************************

// No racial manipulation check

*******************************************************************************************************************************
*** Main regressions [Unweighted]
*******************************************************************************************************************************

reg ov_white_std blackT angry if whiteR==1
reg ov_black_std blackT angry if blackR==1
reg ov_hispn_std blackT angry if hispnR==1
